<template>
  <el-container>
    <el-header height="105px" id="a">
      <el-row :gutter="20">
        <el-col :span="2"
          ><div class="grid-content">
            <img src="../assets/sy1.png" style="margin-top:8px" alt="" /></div
        ></el-col>
        <el-col :span="22">
          <div class="grid-content">
            <h1>呼和浩特发展和改革委员会</h1>
            <p>Hohhot development and Reform Commission</p>
          </div>
        </el-col>
      </el-row>
    </el-header>

    <el-main style="height: 500px">
      <el-form ref="form" :model="form" label-width="100px" id="f">
        <h1 style="text-align: center">用户登录</h1>
        <el-form-item label="用户名:">
          <el-input v-model="form.enterpriseAccountNumber" placeholder="请输入用户名" clearable></el-input>
        </el-form-item>
        <el-form-item label="密码:" >
          <el-input
            v-model="form.enterprisePassword"
            type="password"
            placeholder="请输入密码"
            clearable
          ></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="onSubmit">立即登录</el-button>
          <el-button @click="onReg">在线注册</el-button>
        </el-form-item>
        <el-form-item>
          <p :class="change">账号或密码错误</p>
        </el-form-item>
      </el-form>
    </el-main>
    <el-footer style="height:150px">
      <el-row :gutter="20">
        <el-col :span="4" style="border-right:1px dotted gray">
          <ul class="list">
            <li>
              <a href="#" target="_blank">网站地图</a>
            </li>
            <li>
              <a href="#" target="_blank">联系我们</a>
            </li>
            <li>
              <a href="#" target="_blank">网站声明</a>
            </li>
          </ul>
        </el-col>
        <el-col :span="8" style="border-right:1px dotted gray">
           <p>主办单位：呼和浩特市发展和改革委员会</p>
            <p>电 话：0471-4606322</p>
            <p>技术支持：内蒙古凌动信息科技有限公司</p>
            <p><a href="#" target="_blank">蒙公网安备15010202150110号</a></p>
        </el-col>
        <el-col :span="12">
           <p>承办单位：呼和浩特市发展和改革委员会办公室</p>
                <p>E-Mail ：hsfgwxxk@163.com</p>
                <p>政府网站标识码 ：1501000029</p>
                <p>备 案：<a target="_blank" href="#" rel="nofollow">蒙ICP备20000349号-1</a></p>
        </el-col>
      </el-row>
      
    </el-footer>
  </el-container>
</template>
<script>
export default {
  data() {
    return {
      change:'tip',
      form: {
        enterpriseAccountNumber: "",
        enterprisePassword: "",
      },
    };
  },
  methods: {
    async onSubmit() {
      await this.$http
        .post("http://192.168.43.140:8091/enterprise/login", this.form)
        .then((res) => {
          console.log(res);
          if (res.data == "") {
            console.log(this);
            this.change="vis";
          } else {
            this.$router.push("/platform");
          }
        })
        .catch((err) => {
          console.log(err);
        });
    },
    onReg() {
      this.$router.push("/register");
    },
  },
};
</script>
<style>
#a {
  background-image: url("../assets/sy2.png");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  color: #333;
}
.el-main {
  background-image: url("../assets/sy3.png");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  color: #333;
}
.el-footer {
  background-color: #6c0200;
  color: #f7c3a3;
}
.el-container {
  margin: 0;
}
#f {
  background-color: white;
  margin-left: 800px;
  margin-top: 50px;
  margin-right: 50px;
  width: 400px;
  height: auto;
  padding: 20px;
  opacity: 95%;
}
.list {
  list-style: none;
}
a {
  color: #f7c3a3;
}
.tip{
  visibility:hidden;

}
.vis{
  visibility: visible;
  color: red;
  padding-left: 50px;

}
</style>